-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Refactor MappingElasticsearchConverter #1677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two minor remarks
@@ -67,14 +68,14 @@ | |||
* {@link Converter} to write a {@link Point} to {@link Map} using {@code lat/long} properties. | |||
*/ | |||
@WritingConverter | |||
public enum PointToMapConverter implements Converter<Point, Map<String, Object>> { | |||
public enum PointToMapConverter implements Converter<Point, Document> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we rename all these converters from MapTo...
and ...ToMap
into DocumentTo...
and ...ToDocument
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Let's do that for the next major version as converters are public classes.
* Extension of {@link SpELExpressionParameterValueProvider} to recursively trigger value conversion on the raw | ||
* resolved SpEL value. | ||
* | ||
* @author Mark Oaluch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @author Mark Oaluch | |
* @author Mark Paluch |
But these changes do not remove the messages on startup:
|
It seems, that we need to add |
Actually, this change is quite useful as some components in the Template API lookup |
important is, that the tests still run, we have some places where people read and write generic/dynamic lists, maps and stuff; these known cases are covered by tests, so as long as they don't break |
I had to update one test as the top-level document now writes a |
I decided to revert the converters change. They now are returning |
I'll check after work today |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one comment about the test change; other wise to merge.
@@ -211,6 +211,7 @@ public void init() { | |||
shotGunAsMap.put("_class", ShotGun.class.getName()); | |||
|
|||
notificationAsMap = Document.create(); | |||
notificationAsMap.put("_class", Notification.class.getName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, that change is not really necessary as line 221 (old) already has this. Although using the class to get the name instead of the string is better.
* Add support for SpEL expressions via @value. * Simplify readCollectionOrArray to consider properly nested lists and maps * Simplify readMap to allow reading generic maps and entities in maps. * Report a fallback TypeInformation in DefaultElasticsearchTypeMapper to properly convert nested maps. We now no longer rely on isSimpleType when writing Maps. This is the preparation to consider Map as simple type. Resolves #1676. See #1675.
Fix PersistenceConstructor of Completion to accept the property type String[]. See #1675.
Review comments are addressed, commits are squashed and this one is now ready to be merged. |
I have 4 commits that the issue branch is ahead of master, the first changing the pom. I can cherry pick the 3 commits with code changes, but if I do this, how do I finish this PR? |
See https://github.com/spring-projects/spring-data-build/blob/master/CONTRIBUTING.adoc#commit-messages. Specifically, cherry-pick commits, update the commit message and close this PR/delete the branch. Does that help? |
commits cherrypicked into master |
Hi, when will we have this released? Thanks! |
That's included since Feb 17th (release 4.2.0.M4). 4.2.0.RC1 will be released these days, 4.2.0.GA will robably come mid April |
@sothawo Thanks! |
@Value
.readCollectionOrArray
to consider properly nested lists and mapsreadMap
to allow reading generic maps and entities in mapsThis allows adding
Document
toElasticsearchSimpleTypes
.Also, update
DefaultElasticsearchTypeMapper
to report a fallbackTypeInformation
to properly convert nested maps.Closes #1676.